package com.ys.controller.web.storage;

import com.ys.config.MenuId;
import com.ys.dto.SubGridConfigDto;
import com.ys.entity.storage.TccAllocate;
import com.ys.entity.storage.TccLogisticsSadFile;
import com.ys.entity.sys.YsProcInst;
import com.ys.enume.flow.YsProcInstEnum;
import com.ys.enume.storage.TccAllocateEnum;
import com.ys.service.storage.TccAllocateService;
import com.ys.service.sys.CommonApiService;
import com.ys.vo.W;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/web/storage/tccLogisticsSadFile")
public class WebTccLogisticsSadFileController {
	
	@Autowired
	private CommonApiService<TccLogisticsSadFile> commonApiService;


	/*
	 * 新增
	 */
	@GetMapping("/toAdd")
	public String toAdd(Model model, HttpServletRequest request, HttpServletResponse response){

		try {

			TccLogisticsSadFile entity = new TccLogisticsSadFile();
			// 子列表配置信息

			SubGridConfigDto subGridConfig = commonApiService.getSubGrid(MenuId.TCC_LogisticsSadFile, new ArrayList<Map<String, Object>>());

			return commonApiService.toAdd(model, entity, MenuId.TCC_LogisticsSadFile, null, subGridConfig);
		} catch (Exception e) {
			e.printStackTrace();
			return W.error(model, e.getMessage());
		}
	}
	
}